CWD= $(shell pwd)
export SRC_DIR= $(CWD)/src
export OBJ_DIR=$(CWD)/obj
export BIN_DIR=$(CWD)/bin
export LIB_DIR=$(CWD)/lib

export CC=gcc
export AR=ar
export CFLAGS=-W -Wall -O2 -g
export LDFLAGS=

EXEC=jeu_s jeu_c


all: $(EXEC)
 
$(EXEC):
	@echo "*******************************************"
	@echo Building $@
	@echo "*******************************************"
	@(cd "$(SRC_DIR)" && $(MAKE) $@)
	@echo "*******************************************"
	@echo $@ built!
	@echo "*******************************************"

install :
	@cp bin/jeu_s /usr/bin
	@cp bin/jeu_c /usr/bin
	
.PHONY: clean mrproper install $(EXEC)

clean:
	@(cd $(SRC_DIR) && $(MAKE) $@)

mrproper: clean
	@(cd $(SRC_DIR) && $(MAKE) $@)
			